package com.leo.base.db.router.rule;

import java.util.Random;

public class RandomRule {

    private String[] dataSourceKey;

    public void setDataSourceKey(String[] dataSourceKey) {
        this.dataSourceKey = dataSourceKey;
    }

    public String getDataSourceKey() {
        Random rand = new Random();
        int i = rand.nextInt(dataSourceKey.length);
        return dataSourceKey[i];
    }
}
